04. Install the Firebase CLI
Let's get started using the Firebase SDK for Cloud Functions.
The first thing you need to do is install the command line tools for Firebase, the Firebase CLI (Command Line Interface). The Firebase CLI will allow you to deploy your functions from your computer onto Google Cloud infrastructure.
Installing the Firebase CLI
The Firebase CLI (Command Line Interface) requires Node.js and npm, which you can install by following the instructions on https://nodejs.org/. Installing Node.js also installs npm, the Node.js package manager. The Firebase CLI requires Node.js version 6.3.1 or greater, so the long-term support (LTS) version as of March 8, 2017 will work fine.
Once you've install Node.js and npm, you can verify that the installation went correctly by running them on the command line. You can open up the Terminal (on Mac and Linux) or Command Prompt (on Windows) and running node --version and npm --version:
$ node --version
v6.9.5
$ npm --version
3.10.9
Once you've installed Node.js and npm, you can use npm to install the Firebase CLI:
npm install -g firebase-tools
If you get an error at this step you can fix it by changing your npm permissions.
If everything is installed correctly, you should be able to run the firebase command successfully and get a version number output for this command:
$ firebase --version
3.3.0
The version number can be 3.3.0 or higher.
Now that you have the Firebase CLI installed, let's continue to the next step and create your local project, where you'll write your Cloud Functions for Firebase.
Task: Install the Firebase CLI
Task Feedback:
Nice work! The Firebase CLI is our interface to deploy our cloud functions to the cloud.